/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package caa.struts.course.form;

import java.util.ArrayList;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import th.com.entity.CourseEntity;
import th.com.entity.LocationEntity;
import th.com.entity.ScheduleEntity;
import th.com.entity.SemesterEntity;
import th.com.entity.SubjectEntity;
import th.com.entity.UserEntity;

/**
 *
 * @author omega
 */
public class ManageCourseForm extends ActionForm {

    private String SubjectId = "";
    private String SubjectNameThai = "";
    private String SubjectNameEng = "";
    private String SubjectCreditType = "";
    private String SubjectCredit = "";
    private String SemesterSemester = "";
    private String SemesterAcademicYear = "";
    private Date CourseBeginDate;
    private Date CourseEndDate;
    private String CourseDaySun = "";
    private String CourseDayMon = "";
    private String CourseDayTue = "";
    private String CourseDayWed = "";
    private String CourseDayThu = "";
    private String CourseDayFri = "";
    private String CourseDaySat = "";
    private String CourseBeginTime = "";
    private String CourseEndTime = "";
    private String CourseDuration = "";
    private String LocationName = "";
    private Double CoursePricePerCourse;
    private Date ScheduleTeachDate;
    private String UserId = "";
    private String UserName = "";
    
    private int couId;
    private String mode = "";
    
    private String kwKeyWord = "";
    private String kwKeyWordSubject = "";
    private String kwKeyCourse = "";
    private String kwKeyCourseSelect = "";
    
    private String teachRowId = "";
   
    private CourseEntity courseEntity = new CourseEntity();
    private SemesterEntity semesterEntity = new SemesterEntity();
    
    private ArrayList<CourseEntity> courseList = new ArrayList<CourseEntity>();
    private UserEntity userEntity = new UserEntity();
    private ArrayList<UserEntity> userList = new ArrayList<UserEntity>();
    private LocationEntity locationEntity = new LocationEntity();
    private ArrayList<LocationEntity> locationList = new ArrayList<LocationEntity>();
    private SubjectEntity subjectEntity = new SubjectEntity();
    private ArrayList<SubjectEntity> subjectList = new ArrayList<SubjectEntity>();
    
    private ArrayList<UserEntity> selectTeacher = new ArrayList<UserEntity>();
    private ArrayList<ScheduleEntity> listScheule = new ArrayList<ScheduleEntity>(); 

    public ArrayList<ScheduleEntity> getListScheule() {
        return listScheule;
    }

    public void setListScheule(ArrayList<ScheduleEntity> listScheule) {
        this.listScheule = listScheule;
    }

    public ArrayList<UserEntity> getSelectTeacher() {
        return selectTeacher;
    }

    public void setSelectTeacher(ArrayList<UserEntity> selectTeacher) {
        this.selectTeacher = selectTeacher;
    }
    
    public String getKwKeyCourseSelect() {
        return kwKeyCourseSelect;
    }

    public void setKwKeyCourseSelect(String kwKeyCourseSelect) {
        this.kwKeyCourseSelect = kwKeyCourseSelect;
    }

    public int getCouId() {
        return couId;
    }

    public void setCouId(int couId) {
        this.couId = couId;
    }

    /**
     * @return the SubjectId
     */
    public String getSubjectId() {
        return SubjectId;
    }

    public String getKwKeyCourse() {
        return kwKeyCourse;
    }

    public void setKwKeyCourse(String kwKeyCourse) {
        this.kwKeyCourse = kwKeyCourse;
    }

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    /**
     * @param SubjectId the SubjectId to set
     */
    public void setSubjectId(String SubjectId) {
        this.SubjectId = SubjectId;
    }

    /**
     * @return the SubjectNameThai
     */
    public String getSubjectNameThai() {
        return SubjectNameThai;
    }

    /**
     * @param SubjectNameThai the SubjectNameThai to set
     */
    public void setSubjectNameThai(String SubjectNameThai) {
        this.SubjectNameThai = SubjectNameThai;
    }

    /**
     * @return the SubjectNameEng
     */
    public String getSubjectNameEng() {
        return SubjectNameEng;
    }

    /**
     * @param SubjectNameEng the SubjectNameEng to set
     */
    public void setSubjectNameEng(String SubjectNameEng) {
        this.SubjectNameEng = SubjectNameEng;
    }

    /**
     * @return the SubjectCreditType
     */
    public String getSubjectCreditType() {
        return SubjectCreditType;
    }

    /**
     * @param SubjectCreditType the SubjectCreditType to set
     */
    public void setSubjectCreditType(String SubjectCreditType) {
        this.SubjectCreditType = SubjectCreditType;
    }

    /**
     * @return the SubjectCredit
     */
    public String getSubjectCredit() {
        return SubjectCredit;
    }

    /**
     * @param SubjectCredit the SubjectCredit to set
     */
    public void setSubjectCredit(String SubjectCredit) {
        this.SubjectCredit = SubjectCredit;
    }

    /**
     * @return the SemesterSemester
     */
    public String getSemesterSemester() {
        return SemesterSemester;
    }

    /**
     * @param SemesterSemester the SemesterSemester to set
     */
    public void setSemesterSemester(String SemesterSemester) {
        this.SemesterSemester = SemesterSemester;
    }

    /**
     * @return the SemesterAcademicYear
     */
    public String getSemesterAcademicYear() {
        return SemesterAcademicYear;
    }

    /**
     * @param SemesterAcademicYear the SemesterAcademicYear to set
     */
    public void setSemesterAcademicYear(String SemesterAcademicYear) {
        this.SemesterAcademicYear = SemesterAcademicYear;
    }

    /**
     * @return the CourseBeginDate
     */
    public Date getCourseBeginDate() {
        return CourseBeginDate;
    }

    /**
     * @param CourseBeginDate the CourseBeginDate to set
     */
    public void setCourseBeginDate(Date CourseBeginDate) {
        this.CourseBeginDate = CourseBeginDate;
    }

    /**
     * @return the CourseEndDate
     */
    public Date getCourseEndDate() {
        return CourseEndDate;
    }

    /**
     * @param CourseEndDate the CourseEndDate to set
     */
    public void setCourseEndDate(Date CourseEndDate) {
        this.CourseEndDate = CourseEndDate;
    }

    /**
     * @return the CourseDaySun
     */
    public String getCourseDaySun() {
        return CourseDaySun;
    }

    /**
     * @param CourseDaySun the CourseDaySun to set
     */
    public void setCourseDaySun(String CourseDaySun) {
        this.CourseDaySun = CourseDaySun;
    }

    /**
     * @return the CourseDayMon
     */
    public String getCourseDayMon() {
        return CourseDayMon;
    }

    /**
     * @param CourseDayMon the CourseDayMon to set
     */
    public void setCourseDayMon(String CourseDayMon) {
        this.CourseDayMon = CourseDayMon;
    }

    /**
     * @return the CourseDayTue
     */
    public String getCourseDayTue() {
        return CourseDayTue;
    }

    /**
     * @param CourseDayTue the CourseDayTue to set
     */
    public void setCourseDayTue(String CourseDayTue) {
        this.CourseDayTue = CourseDayTue;
    }

    /**
     * @return the CourseDayWed
     */
    public String getCourseDayWed() {
        return CourseDayWed;
    }

    /**
     * @param CourseDayWed the CourseDayWed to set
     */
    public void setCourseDayWed(String CourseDayWed) {
        this.CourseDayWed = CourseDayWed;
    }

    /**
     * @return the CourseDayThu
     */
    public String getCourseDayThu() {
        return CourseDayThu;
    }

    /**
     * @param CourseDayThu the CourseDayThu to set
     */
    public void setCourseDayThu(String CourseDayThu) {
        this.CourseDayThu = CourseDayThu;
    }

    /**
     * @return the CourseDayFri
     */
    public String getCourseDayFri() {
        return CourseDayFri;
    }

    /**
     * @param CourseDayFri the CourseDayFri to set
     */
    public void setCourseDayFri(String CourseDayFri) {
        this.CourseDayFri = CourseDayFri;
    }

    /**
     * @return the CourseDaySat
     */
    public String getCourseDaySat() {
        return CourseDaySat;
    }

    /**
     * @param CourseDaySat the CourseDaySat to set
     */
    public void setCourseDaySat(String CourseDaySat) {
        this.CourseDaySat = CourseDaySat;
    }

    /**
     * @return the CourseBeginTime
     */
    public String getCourseBeginTime() {
        return CourseBeginTime;
    }

    /**
     * @param CourseBeginTime the CourseBeginTime to set
     */
    public void setCourseBeginTime(String CourseBeginTime) {
        this.CourseBeginTime = CourseBeginTime;
    }

    /**
     * @return the CourseEndTime
     */
    public String getCourseEndTime() {
        return CourseEndTime;
    }

    /**
     * @param CourseEndTime the CourseEndTime to set
     */
    public void setCourseEndTime(String CourseEndTime) {
        this.CourseEndTime = CourseEndTime;
    }

    /**
     * @return the CourseDuration
     */
    public String getCourseDuration() {
        return CourseDuration;
    }

    /**
     * @param CourseDuration the CourseDuration to set
     */
    public void setCourseDuration(String CourseDuration) {
        this.CourseDuration = CourseDuration;
    }

    /**
     * @return the LocationName
     */
    public String getLocationName() {
        return LocationName;
    }

    /**
     * @param LocationName the LocationName to set
     */
    public void setLocationName(String LocationName) {
        this.LocationName = LocationName;
    }

    /**
     * @return the CoursePricePerCourse
     */
    public Double getCoursePricePerCourse() {
        return CoursePricePerCourse;
    }

    /**
     * @param CoursePricePerCourse the CoursePricePerCourse to set
     */
    public void setCoursePricePerCourse(Double CoursePricePerCourse) {
        this.CoursePricePerCourse = CoursePricePerCourse;
    }

    /**
     * @return the ScheduleTeachDate
     */
    public Date getScheduleTeachDate() {
        return ScheduleTeachDate;
    }

    /**
     * @param ScheduleTeachDate the ScheduleTeachDate to set
     */
    public void setScheduleTeachDate(Date ScheduleTeachDate) {
        this.ScheduleTeachDate = ScheduleTeachDate;
    }

    /**
     * @return the UserId
     */
    public String getUserId() {
        return UserId;
    }

    /**
     * @param UserId the UserId to set
     */
    public void setUserId(String UserId) {
        this.UserId = UserId;
    }

    /**
     * @return the kwKeyWord
     */
    public String getKwKeyWord() {
        return kwKeyWord;
    }

    /**
     * @param kwKeyWord the kwKeyWord to set
     */
    public void setKwKeyWord(String kwKeyWord) {
        this.kwKeyWord = kwKeyWord;
    }

    /**
     * @return the courseEntity
     */
    public CourseEntity getCourseEntity() {
        return courseEntity;
    }

    /**
     * @param courseEntity the courseEntity to set
     */
    public void setCourseEntity(CourseEntity courseEntity) {
        this.courseEntity = courseEntity;
    }

    /**
     * @return the courseList
     */
    public ArrayList<CourseEntity> getCourseList() {
        return courseList;
    }

    /**
     * @param courseList the courseList to set
     */
    public void setCourseList(ArrayList<CourseEntity> courseList) {
        this.courseList = courseList;
    }

    /**
     * @return the userList
     */
    public ArrayList<UserEntity> getUserList() {
        return userList;
    }

    /**
     * @param userList the userList to set
     */
    public void setUserList(ArrayList<UserEntity> userList) {
        this.userList = userList;
    }

    /**
     * @return the UserName
     */
    public String getUserName() {
        return UserName;
    }

    /**
     * @param UserName the UserName to set
     */
    public void setUserName(String UserName) {
        this.UserName = UserName;
    }

    /**
     * @return the userEntity
     */
    public UserEntity getUserEntity() {
        return userEntity;
    }

    /**
     * @param userEntity the userEntity to set
     */
    public void setUserEntity(UserEntity userEntity) {
        this.userEntity = userEntity;
    }

    /**
     * @return the locationEntity
     */
    public LocationEntity getLocationEntity() {
        return locationEntity;
    }

    /**
     * @param locationEntity the locationEntity to set
     */
    public void setLocationEntity(LocationEntity locationEntity) {
        this.locationEntity = locationEntity;
    }

    /**
     * @return the locationList
     */
    public ArrayList<LocationEntity> getLocationList() {
        return locationList;
    }

    /**
     * @param locationList the locationList to set
     */
    public void setLocationList(ArrayList<LocationEntity> locationList) {
        this.locationList = locationList;
    }

    /**
     * @return the subjectEntity
     */
    public SubjectEntity getSubjectEntity() {
        return subjectEntity;
    }

    /**
     * @param subjectEntity the subjectEntity to set
     */
    public void setSubjectEntity(SubjectEntity subjectEntity) {
        this.subjectEntity = subjectEntity;
    }

    /**
     * @return the subjectList
     */
    public ArrayList<SubjectEntity> getSubjectList() {
        return subjectList;
    }

    /**
     * @param subjectList the subjectList to set
     */
    public void setSubjectList(ArrayList<SubjectEntity> subjectList) {
        this.subjectList = subjectList;
    }

    /**
     * @return the kwKeyWordSubject
     */
    public String getKwKeyWordSubject() {
        return kwKeyWordSubject;
    }

    /**
     * @param kwKeyWordSubject the kwKeyWordSubject to set
     */
    public void setKwKeyWordSubject(String kwKeyWordSubject) {
        this.kwKeyWordSubject = kwKeyWordSubject;
    }

    public String getTeachRowId() {
        return teachRowId;
    }

    public void setTeachRowId(String teachRowId) {
        this.teachRowId = teachRowId;
    }
    
    public ScheduleEntity getListSch(int index) {
        ScheduleEntity entity = new ScheduleEntity();
        if(!this.listScheule.isEmpty()) {
            entity = this.listScheule.get(index);
        }
        return entity;
    }
    
    public void setListSch(int index,ScheduleEntity entity) {
        if(!this.listScheule.isEmpty()) {
            this.listScheule.set(index, entity);
        }
    }

    @Override
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        this.kwKeyCourse = "";
        this.kwKeyCourseSelect = "";
        this.courseEntity.setCouDayMon(null);
        this.courseEntity.setCouDayTue(null);
        this.courseEntity.setCouDayWed(null);
        this.courseEntity.setCouDayThu(null);
        this.courseEntity.setCouDayFri(null);
        this.courseEntity.setCouDaySat(null);
        this.courseEntity.setCouDaySun(null);
        this.couId = 0;
    }

    public SemesterEntity getSemesterEntity() {
        return semesterEntity;
    }

    public void setSemesterEntity(SemesterEntity semesterEntity) {
        this.semesterEntity = semesterEntity;
    }
    
    public boolean getModeView() {
        boolean rs = false;
//        System.out.println(this.mode);
        if(this.mode.equalsIgnoreCase("view")) {
            rs = true;
        }
        return rs;
    }
    
    
}
